package com.bblocks.http.converter;


import lombok.extern.slf4j.Slf4j;
import org.springframework.http.converter.HttpMessageConverter;

import java.util.List;

/**
 * 统一Web配置，启动新的编码
 * @author Jin
 * @version 1.0
 * @date 2022/6/6 10:56
 */
@Slf4j
//@Configuration
//WebMvcConfigurer@ConditionalOnProperty(name = "bblocks.cachefresh.unative.enabled", matchIfMissing = false)
public class ExtraConverterWebMvcConfigurer implements org.springframework.web.servlet.config.annotation.WebMvcConfigurer {


	/**
	 * 支持kryo响应
	 * @param converters
	 */
	@Override
	public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
		log.info("converters:{}", converters);
		converters.add(new KryoHttpMessageConverter());
		converters.add(new FuryHttpMessageConverter());

		log.info("add new converter after:{},size:{}",converters,converters.size() );
	}
}
